<template>
    <view class="content">
        <view v-if="identity == 4">
            
            
            
            <u-sticky>
                <view class="nav">
                    <view class="nav-i" :class="{active : type == 1}" @click="chooseNav(1)">找车</view>
                    <view class="nav-i" :class="{active : type == 2}" @click="chooseNav(2)">
                        车辆审核<text class="u-font-24" v-if="vehicleNumer.number">({{vehicleNumer.number}})</text>
                    </view>
                    <view class="nav-i" :class="{active : type == 3}" @click="chooseNav(3)">
                        拒绝接单<text class="u-font-24" v-if="vehicleNumer.number1">({{vehicleNumer.number1}})</text>
                    </view>
                </view>
            </u-sticky>
                    
            
            <view class="wrapper" v-if="type == 1">
                <view class="top">
                    <image src="../../static/icon/order.png" class="o-icon"></image>
                    <view>运输线路：</view>
                    <view class="dest">{{vehicleData.line}}</view>
                </view>
                
                <view class="box">
                    <view class="item">
                        <view class="item-l">始发地</view>
                        <view class="item-r">{{vehicleData.origin}}</view>
                    </view>
                    <view class="item">
                        <view class="item-l">目的地</view>
                        <view class="item-r">{{vehicleData.destination}}</view>
                    </view>
                    <view class="item">
                        <view class="item-l">装车地点</view>
                        <view class="item-r">{{vehicleData.loading_site}}</view>
                    </view>
                </view>
                
                <view class="box">
                    
                    <view class="item" v-if="find.vehicle">
                        <view class="item-l">车辆类型</view>
                        <view class="item-r" @click=" listShow = true ">
                            <view class="car" v-if="!find.vehicle.label">请选择车辆类型</view>
                            <view v-else>{{find.vehicle.label}}</view>
                            <u-icon name="arrow-right" color="#979797" size="28" class="u-m-l-15"></u-icon>
                        </view>
                    </view>
                    
                    <view class="item" v-if="find.length">
                        <view class="item-l">车长要求</view>
                        <view class="item-r" @click=" listShow1 = true ">
                            <view class="car" v-if="!find.length.label">请选择车长</view>
                            <view v-else>{{find.length.label}}</view>
                            
                            <u-icon name="arrow-right" color="#979797" size="28" class="u-m-l-15"></u-icon>
                            
                        </view>
                    </view>
                    <view class="item" v-if="find.load">
                        <view class="item-l">载重要求</view>
                        <view class="item-r" @click=" listShow2 = true ">
                            <view class="car" v-if="!find.load.label">请选择载重</view>
                            <view v-else>{{find.load.label}}</view>
                            
                            <u-icon name="arrow-right" color="#979797" size="28" class="u-m-l-15"></u-icon>
                        </view>
                    </view>
                    <view class="item" @click="showTime = true,timeType=1">
                        <view class="item-l">发车时间</view>
                        <view class="item-r" v-if="find.timeS">
                            
                         
                            
                            <view class="car" v-if="!find.timeS.year">请选择发车时间</view>
                            <view v-else>{{find.timeS.year}}-{{find.timeS.month}}-{{find.timeS.day}} {{find.timeS.hour}}:00</view>
                            <u-icon name="arrow-right" color="#979797" size="28" class="u-m-l-15"></u-icon>
                        </view>
                    </view>
                    <view class="item" @click="showTime = true,timeType=2">
                        <view class="item-l">到达时间</view>
                        <view class="item-r">
                            <view class="car" v-if="!find.timeE.year">请选到达时间</view>
                            <view v-else>{{find.timeE.year}}-{{find.timeE.month}}-{{find.timeE.day}} {{find.timeE.hour}}:00</view>
                            <u-icon name="arrow-right" color="#979797" size="28" class="u-m-l-15"></u-icon>
                        </view>
                    </view>
                    
                    <view class="item">
                        <view class="item-l">租赁费用</view>
                        <view class="item-r">
                            <input type="text" placeholder="请输入" class="inp" v-model="find.costs">
                        </view>
                    </view>
                    <view class="item">
                        <view class="item-l">车辆数量</view>
                        <view class="item-r">
                            <input type="text" placeholder="请输入" class="inp" v-model="find.num">
                        </view>
                    </view>
                </view>
                
                <view>
                    <view class="box2">
                        
                        
                        
						<view class="item" @click="showMode = true">
						    <view class="item-l">派单模式</view>
						    <view class="item-r">
                                
                                <view class="car" v-if="!dispatch.label">请选择派单模式</view>
                                <view v-else>{{dispatch.label}}</view>
                                
						        <!-- <input type="text" placeholder="请选择派单模式" class="inp" disabled> -->
						        <u-icon name="arrow-right" color="#979797" size="28" class="u-m-l-15"></u-icon>
						    </view>
						</view>
                        
                        
                       <view v-for="(oitem,key) in dispatch.carList" v-if="dispatch.checked" :key="key" @click="selectDriver(),dispatchIndex = key">
                            <view class="item">
                                <view class="item-l">指定司机</view>
                                <view class="item-r">                                    
                                    <view class="car" v-if="!oitem.name">请选择司机</view>
                                    <view v-else>{{oitem.name}}</view>
                                    
                                    <u-icon name="arrow-right" color="#979797" size="28" class="u-m-l-15"></u-icon>
                                </view>
                            </view>
                            
                            <view class="plate">
                                <view class="plate-no">NO.</view>
                                <view>{{oitem.number||'000000'}}</view>
                            </view>
                            
                            <view class="u-flex u-row-right u-padding-top-10" style="width: 100%;">
                                
                                <image src="../../static/icon/del.png" class="del-02" v-if="dispatch.carList.length > 1" @click.stop="delDriver(key)"></image>
                                
                            </view>
                            
                        </view>
                        
                    </view>
                    
                    <!-- {{dispatch}} -->
                    
                    <view class="btns" v-if="dispatch.carList&&dispatch.carList[0]&&dispatch.mode==1">
                        <image src="../../static/icon/add_02.png" class="add-02" @click="addDriver"></image>
                    </view>
                </view>
                
                
                <view class="box">
                    <view class="item-col">
                        <view class="item-l">备注</view>
                        <textarea v-model="find.remarks" maxlength="200" :auto-height="true" placeholder="请输入备注信息" class="t-inp"></textarea>
                    </view>
                </view>
                <!-- $noMultipleClicks(next) -->
                <!-- <view class="btn" @click="$noMultipleClicks(find_car)">去找车</view> -->
                
                <view class="btn" @click="$u.throttle(find_car, 2000)">去找车</view>
                
            </view>
            
            <view class="wrapper" v-if="type == 2">
                <view class="box3" v-for="(item, index) in vehicleReviewList" :key="index">
                    <view class="item2">
                        <view class="left">车辆类型</view>
                        <view class="right">{{item.vehicle}}</view>
                    </view>
                    <view class="item2">
                        <view class="left">车长要求</view>
                        <view class="right">{{item.length}}</view>
                    </view>
                    <view class="item2">
                        <view class="left">载重要求</view>
                        <view class="right">{{item.load}}</view>
                    </view>
                    <view class="item2">
                        <view class="left">发车时间</view>
                        <view class="right">{{item.start_date}}</view>
                    </view>
                    <view class="item2">
                        <view class="left">到达时间</view>
                        <view class="right">{{item.end_date}}</view>
                    </view>
                    <view class="item2">
                        <view class="left">租赁费用</view>
                        <view class="right">{{item.costs}}元</view>
                    </view>
                    <view class="item2">
                        <view class="left">车辆数量</view>
                        <view class="right">{{item.num}}</view>
                    </view>
                    <view class="item2" v-if="item.to_num">
                        <view class="left">审核通过</view>
                        <view class="right">{{item.to_num}}</view>
                    </view>
                    
                    
                    <view class="btns2">
                        <view class="btn1" @click.stop="again(item)">再发一单</view>
                        <view class="btn3" @click.stop="toPage(`/pages/car-review/car-review?id=${item.id}`)">接单明细</view>
                    </view>
                </view>
            </view>
            
            <view class="wrapper" v-if="type == 3">
                <view class="box3" v-for="(item, index) in acceptOrdersList" :key="index">
                    <view class="title">司机信息</view>
                    <view class="item2">
                        <view class="left">姓名</view>
                        <view class="right">{{item.name}}</view>
                    </view>
                    <view class="item2">
                        <view class="left">联系方式</view>
                        <view class="right">{{item.phone}}</view>
                    </view>
                    <view class="title u-p-t-15">车辆信息</view>
                    <view class="item2">
                        <view class="left">类型</view>
                        <view class="right">{{item.vehicle}}</view>
                    </view>
                    <view class="item2">
                        <view class="left">车号</view>
                        <view class="right">{{item.number}}</view>
                    </view>
                    <view class="item2">
                        <view class="left">车长</view>
                        <view class="right">{{item.length}}</view>
                    </view>
                    <view class="item2">
                        <view class="left">载重</view>
                        <view class="right">{{item.load}}</view>
                    </view>
                    
                    <view class="refuse" v-if="item.reason">司机拒绝理由：{{item.reason}}</view>
                </view>
            </view>
        </view>
        
        <view v-if="identity == 5">
            <!-- 扫码卸车，调起摄像头扫码 -->
			<view style="font-size: 40rpx;color: #fff;text-align: center; 
				background-color: #00457f;padding: 40rpx;margin: 60rpx;border-radius: 30rpx;" @click="scanCode">
				扫码
			</view>
            
        </view>
        <!-- 车辆类型 -->
        <u-select v-model="listShow" :list="driver_option.vehicle" label-name="name" @confirm="vehicleConfirm" value-name="id"></u-select>
        <!-- 车长要求 -->
        <u-select v-model="listShow1" :list="driver_option.length" label-name="name" @confirm="vehicleConfirm" value-name="id"></u-select>
        <!-- 载重要求 -->
        <u-select v-model="listShow2" :list="driver_option.load" label-name="name" @confirm="vehicleConfirm" value-name="id"></u-select>
        
        <!-- 指定司机 -->
        
        <u-select v-model="showDriver" :list="list" label-name="name" value-name="id" @confirm="driverConfirm"></u-select>
        
        <!-- 指定派单模式 -->
        
        <u-select v-model="showMode" :list="modeList" label-name="label" value-name="value" @confirm="modoConfirm"></u-select>
        
        <!-- 选择时间 -->
        <u-picker mode="time" v-model="showTime" :params="params" start-year="2024" @confirm="confirmTime"></u-picker>
        
        
        
        
        <!-- 底部导航 -->
        <u-tabbar v-model="current" :list="tab_list" active-color="#00457f" inactive-color="#5d5f6a" :border-top="true" @change="tabbarChange"></u-tabbar>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                current: 0, //底部导航索引
                tab_list: [],
                
                identity: '',//4发货 5卸货
                
                type: 1, //1找车 2车辆审核 3拒绝接单
                
                list: [{
                        name:'定向',
                        id:'1'
                    },
                    {
                        name:'抢单',
                        id:'2'
                    }
                ],//指定司机列表
                
                vehicleData:'',//找车信息
                vehicleReviewList:[],//车辆审核列表
                acceptOrdersList:[],//拒绝接单
                vehicleNumer:{
                    number:0,
                    number1:0
                },
                
                driver_option:[],//车辆类型,车长要求,载重要求
                
                
                listShow:false,//车辆类型
                listShow1:false,//车长要求
                listShow2:false,//载重要求
                showTime:false,//选择时间
                showMode:false,//派单模式
                showDriver:false,
                
                find:{
                    vehicle:{
                        label:''
                    },//车辆类型
                    length:{
                        label:''
                    },//车长
                    load:{
                        label:''
                    },//载重要求
                    
                    timeS:{
                        year: '',
                        month: '',
                        day: '',
                        hour: '',
                        timestamp:''
                    },//发车时间
                    
                    timeE:{
                        year: '',
                        month: '',
                        day: '',
                        hour: '',
                        timestamp:''
                    },//到达时间
                    
                    costs:'',//租赁费用
                    num:'',//车辆数量
                    remarks:'',//备注
                },
                
                
                params: {
                    year: true,
                    month: true,
                    day: true,
                    hour: true,
                    minute: false,
                    second: false,
                    timestamp:true,
                },//设置时间
                
                timeType:1,
                
                dispatch:{
                    mode:'',
                    label:'',
                   
                    value:'',
                    checked:true,
                    carList:[
                        {
                            name:'',
                            nameId:'',
                            number:'',
                        }
                    ]
                
                },//派单
                
                dispatchIndex:0,
                
                modeList:[
                    {
                        label:'定向',
                        value:'1'
                    },
                    {
                        label:'抢单',
                        value:'2'
                    }
                ],
                
                page:1,
                status: 'loadmore', //加载前值
                limit:10,
                
                                
            };
        },
        onLoad() {
            let _this = this;
            
            
            console.log(this.$getSync('identity') == 5)
           
            
			uni.$on('LOGIN', data => {
				if (this.$getSync('identity') == 4) {
				    uni.setNavigationBarTitle({
				    	title:'找车'
				    })
				} else if (this.$getSync('identity') == 5) {
				    uni.setNavigationBarTitle({
				    	title:'扫码卸车'
				    })
				}
			})
        },
        onShow() {
            
            if (this.$getSync('identity') == 4) {
                uni.setNavigationBarTitle({
                	title:'找车'
                })
            } else if (this.$getSync('identity') == 5) {
                uni.setNavigationBarTitle({
                	title:'扫码卸车'
                })
            }
            
            
            this.vehicleReviewList = []//车辆审核列表
            this.acceptOrdersList = [];//拒绝接单
            // 身份
            if(!this.$getTokens()){
                this.$gTo('/pages/login/login');
            }else{
                this.identity = this.$getSync('identity');
                this.tabbarInfo();
                
            }
            
            this.status = 'loadmore'; //加载前值
            this.page = 1;
            this.driver_vehicle()
            
        },
        
        onReachBottom() {
            this.driver_vehicle()
        },
        methods: {
            
            // 再来一单
            again(item) {
                
                // uni.showLoading({
                //     title: '跳转中',
                //     mask: true
                // });
                this.type = 1
                // this.$setSync('order_id_again',item)
                
                // setTimeout(()=>{
                //     uni.hideLoading();
                //     this.$sTo(`/pages/tabbar/tab-4`)
                // },1000)
                
            },
            
			// 扫码卸车
			scanCode() {
				uni.scanCode({
					success: (res) => {
						this.$gTo(`/pages/order/details?out_trade_no=${res.result}`)
					},
				    fail: err => {
				        console.log(err)
				    }
				});
			},
			
			
			
            find_car(){
                
                if(!this.find.vehicle.value){
                    this.$toast('请选择车辆类型');
                    return;
                }
                
                if(!this.find.length.value){
                    this.$toast('请选择车长');
                    return;
                }
                if(!this.find.load.value){
                    this.$toast('请选择载重');
                    return;
                }
                if(!this.find.timeS.year){
                    this.$toast('发车时间');
                    return;
                }
                
                if(!this.find.timeE.year){
                    this.$toast('结束时间');
                    return;
                }
                
                if(!this.find.costs){
                    this.$toast('请填写租赁费用');
                    return;
                }
                
                if(!this.find.num){
                    this.$toast('请填写车辆数量');
                    return;
                }
                
                if(!this.dispatch.mode){
                    this.$toast('请选择派单模式');
                    return;
                }
                if(!this.dispatch.mode){
                    this.$toast('请选择派单模式');
                    return;
                }
                let driver_ids = [];
                if(this.dispatch.mode==1){
                    if(!this.dispatch.carList[0].name){
                        this.$toast('请选择指定司机');
                        return;
                    }else{
                        
                        this.dispatch.carList.forEach(item=>{
                            driver_ids.push(item.nameId)
                        })
                    }
                }
                
                let start_date = this.find.timeS.year +'-'+this.find.timeS.month+'-'+this.find.timeS.day+' '+this.find.timeS.hour+':00'
                let end_date = this.find.timeE.year +'-'+this.find.timeE.month+'-'+this.find.timeE.day+' '+this.find.timeE.hour+':00'
                
                
                // console.log({
                //     user_token:this.$getTokens(),
                //     vehicle_id:this.find.vehicle.value,//1找车 2车辆审核 3拒绝接单
                //     length_id:this.find.length.value,
                //     load_id:this.find.load.value,
                //     start_date:start_date,
                //     end_date:end_date,
                //     costs:this.find.costs,
                //     num:this.find.num,
                //     mode:this.dispatch.mode,
                //     remark:this.find.remark,
                //     driver_ids:driver_ids,
                    
                // })
                // return
                
                this.$ajax('find_car', {
                    user_token:this.$getTokens(),
                    vehicle_id:this.find.vehicle.value,//1找车 2车辆审核 3拒绝接单
                    length_id:this.find.length.value,
                    load_id:this.find.load.value,
                    start_date:start_date,
                    end_date:end_date,
                    costs:this.find.costs,
                    num:this.find.num,
                    mode:this.dispatch.mode,
                    remark:this.find.remarks,
                    driver_ids:driver_ids.join(","),
                    
                }).then(ret => {
                	if (ret.success == 1000) {
                        
                        this.find = {
                                vehicle:{
                                    label:''
                                },//车辆类型
                                length:{
                                    label:''
                                },//车长
                                load:{
                                    label:''
                                },//载重要求
                                
                                timeS:{
                                    year: '',
                                    month: '',
                                    day: '',
                                    hour: '',
                                    timestamp:''
                                },//发车时间
                                
                                timeE:{
                                    year: '',
                                    month: '',
                                    day: '',
                                    hour: '',
                                    timestamp:''
                                },//到达时间
                                
                                costs:'',//租赁费用
                                num:'',//车辆数量
                                remarks:'',//备注
                            };
                            
                            
                        this.dispatch = {
                                mode:'',
                                label:'',
                               
                                value:'',
                                checked:true,
                                carList:[
                                    {
                                        name:'',
                                        nameId:'',
                                        number:'',
                                    }
                                ]
                            
                        }//派单
                        this.$alert(ret.msg)
                	} else {
                		this.$toast(ret.msg);
                	}
                    
                });
            },
            
            
            //1找车 2车辆审核 3拒绝接单
            driver_vehicle(){
                
                
                if(this.type==2||this.type==3){
                    if (this.status == 'nomore') return;
                    this.status == 'loading';
                    
                }
                
                this.$ajax('driver_vehicle', {
                    user_token:this.$getTokens(),
                    status:this.type,//1找车 2车辆审核 3拒绝接单
                    page:this.page,
                    limit:this.limit
                }).then(ret => {
                	if (ret.success == 1000) {
                        if(ret.detail){
                            if(this.type==1){
                                this.vehicleData = ret.detail;
                                this.vehicleNumer = {
                                    number:this.vehicleData.car_count,
                                    number1:this.vehicleData.driver_count
                                };
                                
                            }
                            if(this.type==2){
                                
                                this.vehicleNumer.number = ret.detail.car_count
                                if (ret.detail.data.length > 0) {
                                    this.vehicleReviewList = this.vehicleReviewList.concat(ret.detail.data);
                                    this.page++;
                                    this.status = 'loadmore';
                                } else {
                                    this.status = 'nomore';
                                }
                                
                                // this.vehicleReviewList = this.vehicleReviewList.concat(ret.data.list);
                            }
                            if(this.type==3){
                                this.vehicleNumer.number1 = ret.detail.driver_count
                                if (ret.detail.data.length > 0) {
                                    this.acceptOrdersList = this.acceptOrdersList.concat(ret.detail.data);
                                    this.page++;
                                    this.status = 'loadmore';
                                } else {
                                    this.status = 'nomore';
                                }
                                
                                // this.vehicleReviewList = this.vehicleReviewList.concat(ret.data.list);
                            }
                        }else{
                            this.$toast(ret.detail.msg);
                        }
                        
                	} else {
                		this.$toast(ret.detail.msg);
                	}
                    
                });
            },
            
            //车辆类型/车长/载重
            select_driver_option(){
                this.$ajax('select_driver_option', {
                }).then(ret => {
                	if (ret.success == 1000) {
                        console.log(ret)
                        if(ret.detail){
                            this.driver_option = ret.detail
                        }else{
                            this.$toast(ret.detail.msg);
                        }
                        
                	} else {
                		this.$toast(ret.detail.msg);
                	}
                    
                });
            },
            
            //选择司机
            
            selectDriver(){
                console.log(333)
                if(!this.find.vehicle.value){
                    this.$toast('请选择车辆类型');
                    return;
                }
                
                if(!this.find.length.value){
                    this.$toast('请选择车长');
                    return;
                }
                if(!this.find.load.value){
                    this.$toast('请选择载重');
                    return;
                }
                if(!this.find.timeS.year){
                    this.$toast('发车时间');
                    return;
                }
                
                if(!this.find.timeE.year){
                    this.$toast('结束时间');
                    return;
                }
                let start_date = this.find.timeS.year +'-'+this.find.timeS.month+'-'+this.find.timeS.day+' '+this.find.timeS.hour+':00'
                let end_date = this.find.timeE.year +'-'+this.find.timeE.month+'-'+this.find.timeE.day+' '+this.find.timeE.hour+':00'
                this.$ajax('appoint_driver', {
                    vehicle_id:this.find.vehicle.value,
                    length_id:this.find.length.value,
                    load_id:this.find.load.value,
                    start_date:start_date,
                    end_date:end_date,
                }).then(ret => {
                	if (ret.success == 1000) {
                        if(ret.detail){
                            
                            this.list = ret.detail;
                            this.showDriver = true;
                            
                        }else{
                            this.$toast(ret.detail.msg);
                        }
                        
                	} else {
                		this.$toast(ret.detail.msg);
                	}
                    
                });
            },
            //指定司机
            
            
            appoint_driver(){
                
                this.$ajax('appoint_driver', {
                    
                    vehicle_id:this.vehicleData,
                    length_id:'',
                    load_id:'',
                    
                    start_date:'',
                    end_date:'',
                    
                    
                    
                }).then(ret => {
                	if (ret.success == 1000) {
                        if(ret.detail){
                            this.list = ret.detail
                        }else{
                            this.$toast(ret.detail.msg);
                        }
                        
                	} else {
                		this.$toast(ret.detail.msg);
                	}
                    
                });
            },
            
            
            //获取时间
            confirmTime(e){
                
                var today = new Date();
                var year = today.getFullYear();
                var month = ('0' + (today.getMonth() + 1)).slice(-2);
                var day = ('0' + today.getDate()).slice(-2);
                var hour = ('0'+today.getHours()).slice(-2); // 小时
                var timestamp = Date.parse(today)/1000
                
                
                if(this.timeType==1){
                    
                    if(timestamp>e.timestamp){
                        this.$toast("选择开始时间不能小于当前时间");
                        return
                    }else{
                        this.find.timeS = e;
                    }
                    
                }else{
                    if(!this.find.timeS.year){
                        this.$toast("请先选择开始时间");
                        return
                    }else{
                        if(e.timestamp<this.find.timeS.timestamp){
                            this.$toast("选择结束时间不能小于开始时间");
                            return
                        }else{
                            this.find.timeE = e
                        }
                    
                    }
                }
                
                
                
            },
            //选择指定司机
            driverConfirm(e){
                
                this.list.forEach(item=>{
                    
                    if(item.id==e[0].value){
                        
                        this.dispatch.carList[this.dispatchIndex] = {
                            name: e[0].label,
                            nameId:e[0].value,
                            number:item.number,
                        }
                        
                        
                    }
                })
                
                
            },
            
            //选中类型 车厂 载重
            vehicleConfirm(e){
                if(this.listShow){
                    this.find.vehicle = e[0]
                }else if(this.listShow1){
                    this.find.length = e[0]
                }else if(this.listShow2){
                    this.find.load = e[0]
                }
            },
            //选中的派单模式
            modoConfirm(e){
                console.log(e)
                
                if(e[0].value==1){
                    this.dispatch.checked = true;
                }else{
                    this.dispatch.checked = false;
                }
                this.dispatch.label = e[0].label
                this.dispatch.mode = e[0].value;
            },
            
            chooseNav(num) {
                // this.status = 'loadmore'; //加载前值
                // this.page = 1;
                // this.driver_vehicle()
                
                this.page = 1;
                this.type = num;
                this.vehicleReviewList = [];//车辆审核列表
                this.acceptOrdersList = [];//拒绝接单
                
                
                this.status = 'loadmore'; //加载前值
                this.driver_vehicle()
                
            },
            
            // 添加司机
            addDriver() {
                
                this.dispatch.carList.push({
                    name:'',
                    nameId:'',
                    number:'',
                })
            },
            
            // 删除司机
            delDriver(index) {
                this.dispatch.carList.splice(index, 1)
            },
            
            toPage(url) {
                this.$gTo(url)
            },
            
            //切换底部导航
            tabbarChange(e) {
            	this.current = e;
            },
            
            tabbarInfo(){
                // 发货
                if (this.$getSync('identity') == 4) {
                    if(this.$getSync('authority_car') == 1){
                        this.tab_list = [
                            {
                                iconPath: "/static/icon/tab_01.png",
                                selectedIconPath: "/static/icon/tab_02.png",
                                text: '首页',
                                pagePath: "/pages/tabbar/index"
                            },{
                                iconPath: "/static/icon/tab_03.png",
                                selectedIconPath: "/static/icon/tab_04.png",
                                text: '找车',
                                pagePath: "/pages/tabbar/tab-2"
                            },{
                                iconPath: "/static/icon/tab_05.png",
                                selectedIconPath: "/static/icon/tab_06.png",
                                text: '发货',
                                pagePath: "/pages/tabbar/tab-3"
                            },{
                                iconPath: "/static/icon/tab_07.png",
                                selectedIconPath: "/static/icon/tab_08.png",
                                text: '下单',
                                pagePath: "/pages/tabbar/tab-4"
                            },{
                                iconPath: "/static/icon/tab_09.png",
                                selectedIconPath: "/static/icon/tab_10.png",
                                text: '我的',
                                pagePath: "/pages/tabbar/mine"
                            }
                        ];
                    }else{
                        this.tab_list = [
                            {
                                iconPath: "/static/icon/tab_01.png",
                                selectedIconPath: "/static/icon/tab_02.png",
                                text: '首页',
                                pagePath: "/pages/tabbar/index"
                            },{
                                iconPath: "/static/icon/tab_05.png",
                                selectedIconPath: "/static/icon/tab_06.png",
                                text: '发货',
                                pagePath: "/pages/tabbar/tab-3"
                            },{
                                iconPath: "/static/icon/tab_07.png",
                                selectedIconPath: "/static/icon/tab_08.png",
                                text: '下单',
                                pagePath: "/pages/tabbar/tab-4"
                            },{
                                iconPath: "/static/icon/tab_09.png",
                                selectedIconPath: "/static/icon/tab_10.png",
                                text: '我的',
                                pagePath: "/pages/tabbar/mine"
                            }
                        ];
                    }
                    
                    this.select_driver_option()
                    this.driver_vehicle()
                }
                // 卸货
                if(this.$getSync('identity') == 5){
                    this.tab_list = [
                        {
                            iconPath: "/static/icon/tab_01.png",
                            selectedIconPath: "/static/icon/tab_02.png",
                            text: '首页',
                            pagePath: "/pages/tabbar/index"
                        },{
                            iconPath: "/static/icon/tab_11.png",
                            selectedIconPath: "/static/icon/tab_12.png",
                            text: '扫码卸车',
                            pagePath: "/pages/tabbar/tab-2"
                        },{
                            iconPath: "/static/icon/tab_09.png",
                            selectedIconPath: "/static/icon/tab_10.png",
                            text: '我的',
                            pagePath: "/pages/tabbar/mine"
                        }
                    ];
                }
            },
        }
    };
</script>

<style lang="scss">
    
    
    
    
    page{
        background-color: #eef1f6;
    }
    .nav{
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: #fff;
    }
    .nav-i{
        width: calc(100vw / 3);
        padding: 30rpx 0;
        font-size: 30rpx;
        font-weight: bold;
        text-align: center;
    }
    .active{
        color: #004580;
        position: relative;
    }
    .active::after{
        display: block;
        content: '';
        width: 32rpx;
        height: 8rpx;
        background-color: #004580;
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
    }
    .wrapper{
        padding: 35rpx 20rpx;
    }
    .top{
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 28rpx 30rpx;
        background-color: #004580;
        border-radius: 20rpx;
        margin-bottom: 15rpx;
        font-size: 36rpx;
        color: #fff;
    }
    .o-icon{
        width: 69rpx;
        height: 69rpx;
        margin-right: 15rpx;
    }
    .dest{
        font-weight: bold;
        flex: 1;
    }
    .box{
        background-color: #fff;
        padding: 0 35rpx;
        border-radius: 20rpx;
        margin-bottom: 15rpx;
    }
    .item{
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 30rpx 0;
    }
    .item-l{
        color: #656565;
        padding-right: 20rpx;
    }
    .item-r{
        flex: 1;
        text-align: right;
        font-weight: bold;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
    .inp{
        flex: 1;
        text-align: right;
        font-size: 28rpx;
    }
    
    .box2{
        padding: 0 35rpx 35rpx;
        background-color: #fff;
        border: 2rpx solid #ccd6e5;
        border-radius: 20rpx;
        margin-bottom: 15rpx;
    }
    .plate{
        display: flex;
        justify-content: flex-end;
        align-items: center;
        font-size: 28rpx;
        color: #0075cf;
        font-weight: bold;
    }
    .plate-no{
        width: 60rpx;
        height: 36rpx;
        background-color: #0075cf;
        border-radius: 8rpx;
        font-size: 24rpx;
        color: #fff;
        text-align: center;
        line-height: 36rpx;
        margin-right: 15rpx;
    }
    .btns{
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding-bottom: 30rpx;
    }
    .add-02{
        width: 152rpx;
        height: 56rpx;
    }
    .del-02{
        width: 57rpx;
        height: 57rpx;
        margin-left: 25rpx;
    }
    .item-col{
        padding: 30rpx 0;
    }
    .t-inp{
        background-color: #f5f6fa;
        width: 100%;
        min-height: 180rpx;
        height: auto;
        padding: 20rpx;
        border-radius: 10rpx;
        margin-top: 20rpx;
        font-size: 28rpx;
    }
    
    .btn{
        font-size: 34rpx;
        color: #fff;
        text-align: center;
        padding: 25rpx;
        background-color: #00457f;
        border-radius: 50rpx;
        margin-top: 50rpx;
    }
    
    .box3{
        background-color: #fff;
        border-radius: 20rpx;
        padding: 40rpx 30rpx 30rpx;
        margin-bottom: 15rpx;
    }
    .item2{
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 10rpx;
    }
    .title{
        font-size: 30rpx;
        font-weight: bold;
        padding-bottom: 15rpx;
    }
    .left{
        width: 140rpx;
        color: #656565;
    }
    .right{
        flex: 1;
        word-break: break-all;
        white-space: pre-line;
    }
    .btns2{
        padding-top: 10rpx;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        color: #fff;
    }
    .btn1{
        padding: 15rpx 25rpx;
        background-color: #004580;
        border-radius: 50rpx;
        margin-left: 20rpx;
    }
    .btn3{
        padding: 15rpx 25rpx;
        background-color: #fff;
        border-radius: 50rpx;
        margin-left: 20rpx;
        color: #004580;
        border: 2rpx solid #004580;
        box-sizing: border-box;
    }
    .refuse{
        font-size: 28rpx;
        color: #0075cf;
        word-break: break-all;
        white-space: pre-line;
        padding-top: 30rpx;
        border-top: 2rpx solid #f0f0f0;
    }
    
    .car{
        color: grey;
        font-size:28rpx;
    }
</style>
